<?php       
class ControllerCommonLogout extends Controller {   
    public function index() { 
        $user = $this->auth->get_user();
        $user_dao = $this->auth->get_dao();

        $user_dao->update_user($user, $this->session);
        $user_dao->logout($user);


        $this->auth->logout();

        unset($this->session->data['token']);

        $this->redirect($this->url->link('common/login', '', 'SSL'));
    }
}  
?>
